#ifndef _UTIL_H__
#define _UTIL_H__

int HostLookup(char *IP, const char *hostname);

void milsleep(int ms);

unsigned char *bits_copy(int &bit_empty, unsigned char *dst,
			 unsigned char *src, int numBits);

unsigned char *bits_shift(int &bit_valid, unsigned char *dst,
			 unsigned char *src, int numBits);


void bitLeftShift(unsigned char *cArray,const int iLen,const int iOffset);
void bitRightShift(unsigned char *cArray,const int iLen,const int iOffset);

unsigned short crc16(unsigned char *src, int numBytes, unsigned int poly = 0x1021,
		     unsigned int init = 0xffff, unsigned int close = 0xffff);
unsigned short crc16_l(unsigned char *src, int numBytes, unsigned int poly = 0x8408,
		       unsigned int init = 0xffff, unsigned int close = 0xffff);
unsigned int crc32_l(unsigned char *src, int numBytes, unsigned int poly = 0x8408,
		       unsigned int init = 0xffff, unsigned int close = 0xffff);

unsigned short pppFcs16(unsigned short fcs, unsigned char *cp, int len);

#endif
